<?php
include("../inc/Function_user.php");
upower();
$info = userinfo();
$oid = isset($_GET['id']) ? intval($_GET['id']) : 0;

if($oid == 0){
    echo "<script>alert('订单不存在');window.location.href='orderlist.php';</script>";
    die();
}

// 获取订单详情
$order = orderdetail($oid, $info['Id']);

if(!$order){
    echo "<script>alert('订单不存在');window.location.href='orderlist.php';</script>";
    die();
}

$tpl->assign("order", $order);
$tpl->assign("info", $info);
$tpl->assign("osarr1", $osarr1);
$tpl->assign("osarr2", $osarr2);
$tpl->assign("payarr", $payarr);
$tpl->show("order_detail");
?>
